﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SERVICES;
using SERVICES.Services;

namespace WMILK_MVC4.Tests.Services
{
    [TestClass]
    public class UnitTest1
    {
        //Test GetUser
        [TestMethod]
        public void TestMethod1()
        {
            WMILKEntities2 db= new WMILKEntities2();
            USER us= new USER();
            us.US_NAME = "Khanh";
            us.US_USERNAME = "khanh";
            us.US_PASSWORD = "1";
            us.US_ROLE = 0;
            db.USERS.Add(us);
            db.SaveChanges();
            var u=UserServices.GetUser(1);
            Assert.AreEqual("khanh",u.US_USERNAME);      
        }
        //
        [TestMethod]
        public void TestCheckPassword()
        {
           
            var u = UserServices.Authenticate("khanh","123456");
            Assert.AreEqual(true, u);
        }
    }
    
}
